﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Kkc.Application.Specifications
{
    public class OrSpecification<T> : BinarySpecification<T>
    {
        public OrSpecification(ISpecification<T> leftOperand, ISpecification<T> rightOperand)
            : base(leftOperand, rightOperand)
        {
        }

        protected override System.Linq.Expressions.Expression<Func<T, bool>> CreateBinaryExpression(ISpecification<T> leftOperand, ISpecification<T> rightOperand)
        {
            return System.Linq.Expressions.Expression.Lambda<Func<T, bool>>(System.Linq.Expressions.Expression.OrElse(leftOperand.Expression.Body, rightOperand.Expression.Body), leftOperand.Expression.Parameters);
        }
    }
}